package com.liming.salesman.api.biz;

import com.liming.core.api.biz.IBizService;
import com.liming.salesman.api.persistence.ISalesmanBean;

import javax.ws.rs.GET;
import javax.ws.rs.Path;
import javax.ws.rs.PathParam;
import javax.ws.rs.Produces;
import java.util.List;

/**
 * Created by dell on 14-1-17.
 */

public interface ISalesmanBeanService extends IBizService {
    /**
     * 用户名不存在
     */
    public final static int USERNAME_NOT_EXIST = -1;

    /**
     * 密码错误
     */
    public final static int PASSWORD_ERROR = -2;

    /**
     * 成功
     */
    public final static int SUCCESS = 1;
    /**
     * 位置错误
     */
    public final static int UNKOWN_ERROR = -99;




    public ISalesmanBean addSalesman(ISalesmanBean user);

    public List<ISalesmanBean> getAllSalesman();

    /**
     * 销售顾问登录restful service
     *
     * @param username 用户名
     * @param password 用户密码
     * @return 成功大于0，否则小于0
     */
    @GET
    @Produces("{application/json}")
    @Path("{username}/{password}")
    public int login(@PathParam("username") String username, @PathParam("password") String password);

}
